package com.jd.financeweb.service.impl;

import com.alibaba.fastjson.JSON;
import com.jd.financeweb.dao.LoadDao;
import com.jd.financeweb.pojo.dto.GetRepayProdDTO;
import com.jd.financeweb.pojo.dto.GetRepayRecordDTO;
import com.jd.financeweb.service.LoadService;

import java.util.List;

/**
 * @ClassName LoadServiceImpl
 * @Description TODO
 * @Author LiQingBo
 * @Date 2022/5/22 21:20
 */
public class LoadServiceImpl implements LoadService {

    private LoadDao td = new LoadDao();

    @Override
    public String userRepayProd(String idNo) {
        List<GetRepayProdDTO> getRepayProdDTOS = td.userRepayProd(idNo);
        return JSON.toJSONString(getRepayProdDTOS);
    }

    /**
     * 根据公司编号待还款记录
     *
     * @param cpNo
     * @return
     */
    @Override
    public String companyRepayProd(String cpNo) {
        List<GetRepayProdDTO> getRepayProdDTOS = td.companyRepayProd(cpNo);
        return JSON.toJSONString(getRepayProdDTOS);
    }



    /**
     * 根据身份证号查询还款记录
     * @param idNo
     * @return
     */
    @Override
    public  List<GetRepayRecordDTO> userRepayRecord(String idNo) {
        List<GetRepayRecordDTO> getRepayRecordDTOS = td.userRepayRecord(idNo);
        return getRepayRecordDTOS;
    }
}
